#include <iostream>
using namespace std;

int main() {
    int l, r;
    cin >> l >> r;
    if (l == r) {
        cout << l << endl;
    } else {
        cout << 2 << endl;
    }
}